FROM python:3.11-slim

LABEL maintainer="Browse ETL Team"
LABEL description="Flink Agents - User Behavior Analysis Processor"

# 设置工作目录
WORKDIR /app

# 安装系统依赖
RUN apt-get update && apt-get install -y \
    gcc \
    && rm -rf /var/lib/apt/lists/*

# 复制requirements文件
COPY requirements.txt .

# 安装Python依赖
RUN pip3 install --no-cache-dir -r requirements.txt

# 复制应用代码
COPY consumer.py core.py database.py llm_client.py lambda_handler.py prompt_template.txt prompt_template_v2.txt schema.sql .

# 添加执行权限
RUN chmod +x consumer.py

# 启动命令
CMD ["python3", "-u", "consumer.py"]

